﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace PwjCy.Lite.Core
{
    /// <summary>
    /// 服务提供者接口
    /// </summary>
    public interface IServiceProvider
    {
        /// <summary>
        /// 获取服务类型
        /// </summary>
        /// <typeparam name="TService">服务类型</typeparam>
        /// <returns></returns>
        TService GetService<TService>();
        /// <summary>
        /// 获取服务类型
        /// </summary>
        /// <typeparam name="TService">服务类型</typeparam>
        /// <param name="throwExceptionIfNotFound">是否抛出异常</param>
        /// <returns></returns>
        TService GetService<TService>(bool throwExceptionIfNotFound);
        /// <summary>
        /// 获取服务类型
        /// </summary>
        /// <param name="serviceType">服务接口类型</param>
        /// <returns></returns>
        object GetService(Type serviceType);
        /// <summary>
        /// 获取服务类型
        /// </summary>
        /// <param name="serviceType">服务接口类型</param>
        /// <param name="throwExceptionIfNotFound">是否抛出异常</param>
        /// <returns></returns>
        object GetService(Type serviceType, bool throwExceptionIfNotFound);
    }
}
